Repository navigation
fix: The thinking indicator yields to a reply the frame its bubble shows - #137
Merged
Merged
Conversation
…r lost The dialogue pulse rode exactly one Engine tick while the renderer kept only the newest placement, so a pulse could vanish between animation frames — no speech bubble, and a thinking indicator left to die by timer. The bubble decisions now live in bubble.js as a machine node can test: the event listener latches every pulse, a consumed reply hides the indicator the same frame its bubble shows, and the min-hold delays only silent endings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A new turn starting while a reply was still displayed drew the indicator over it. The indicator now never shows during a line's reading window; when the line hides, a turn still in flight starts its grace from that moment, so a reply landing right then never flashes it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 31, 2026
Merged
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The thinking ellipsis could show alongside a displayed reply (#127's implementation of #119): the user saw the response bubble with the indicator still up, and a new turn starting mid-reply drew the indicator over it.
What
Three renderer defects, one seam:
Speech and the indicator could overlap. A new reactive turn starting while a reply was still in its reading window armed the grace and drew the ellipsis over the displayed line. The machine now holds mutual exclusion with speech strictly winning: while a line is displayed — its whole reading window — the indicator never shows, whatever the in-flight state does. When the line hides, a turn still in flight starts its grace from that moment, so a reply landing right then never flashes the indicator.
A one-tick line could be lost.
Frame.dialoguerides exactly one Engine tick, and the renderer keeps only the newest placement while it waits for its next animation frame. The Engine ticks slightly faster than a display refreshes (16 ms vs ~16.7 ms), so some placements are overwritten beforedrawever samples them — the line vanishes, no speech bubble shows, and the thinking indicator is left to die by its min-hold timer.The clear decision lived in DOM code no test could drive, with the min-hold branch deciding when a shown indicator may hide.
The bubble decisions now live in
src/bubble.jsascreateBubbleMachine— timers injectable, DOM supplied bymain.jsas callbacks. The event listener (which sees every delivery) latches the dialogue pulse; the drawn frame consumes it. A consumed reply hides the thinking indicator synchronously, before its bubble shows — the min-hold delays only silent endings, which is what it was for.Why
#119: "when the reply arrives it becomes the speech bubble in place", and the indicator "can never get stuck: it is a pure function of
InFlightstate each tick". The shell already sends a consistent reply tick (thinking: false+ the dialogue —try_takeclearsbusythe same tick); the renderer was the lossy half.Verify
node --test tests/— 22 pass. The test harness itself pins the exclusion: every show/hide callback in every scenario asserts speech and the indicator are never visible together. New machine tests: a reply hides the indicator the same frame (min-hold pending or not), an overwritten pulse still shows its bubble, silent endings respect the min-hold, a reply faster than the grace never flashes the indicator, a new turn waits behind a displayed reply and surfaces only after it hides (grace restarted), a reply landing in that post-speech grace never flashes it.cargo test --all-targets— 332 green, untouched.🤖 Generated with Claude Code